package com.cmc.cloud.cmclink.doc.service.impl.si;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

import com.cmc.cloud.cmclink.doc.entity.ConfirmNoticeFcnDO;
import com.cmc.cloud.cmclink.doc.mapper.ConfirmNoticeFcnMapper;
import com.cmc.cloud.cmclink.doc.service.si.ConfirmNoticeFcnService;
import com.cmes.framework.mybatis.core.query.LambdaQueryWrapperX;

/**
 * 确认装货港更改通知FCN Service 实现类
 *
 * @author 集运管理员
 */
@Service
@Validated
public class ConfirmNoticeFcnServiceImpl implements ConfirmNoticeFcnService {

    @Resource
    private ConfirmNoticeFcnMapper confirmNoticeFcnMapper;

    @Override
    public List<ConfirmNoticeFcnDO> getFcnByNoticeId(Long noticeId, String frtType) {
        LambdaQueryWrapperX<ConfirmNoticeFcnDO> queryWrapperX = new LambdaQueryWrapperX<>();
        queryWrapperX.eq(ConfirmNoticeFcnDO::getNoticeId, noticeId).eqIfPresent(ConfirmNoticeFcnDO::getFrtType,
            frtType);
        return confirmNoticeFcnMapper.selectList(queryWrapperX);
    }
}
